#include <cstdio>
#include <cstring>
#include <queue>
const int N = 101, M = 501, K = 10;
int n, m, k;
int e_cnt, heads[N], tar[K];
int f[N][1 << K];
struct Edge {
	int v, nxt, w;
} e[M << 1];
inline void add(int u, int v, int w) {
	e[++e_cnt].v = v, e[e_cnt].w = w, e[e_cnt].nxt = heads[u], heads[u] = e_cnt;
}
struct Node {
	int id, val;
	inline bool operator<(const Node &rhs) const { return val > rhs.val; }
};
inline int min(int a, int b) { return a < b ? a : b; }
std::priority_queue< Node > pq;
bool vis[N];
inline void dij(int sta) {
	memset(vis, 0, sizeof(vis));
	while (!pq.empty()) {
		Node x = pq.top();
		pq.pop();
		if (vis[x.id]) continue;
		vis[x.id] = true;
		for (int i = heads[x.id]; i; i = e[i].nxt) {
			int v = e[i].v;
			if (f[v][sta] > f[x.id][sta] + e[i].w) {
				f[v][sta] = f[x.id][sta] + e[i].w;
				pq.push({v, f[v][sta]});
			}
		}
	}
}
int main() {
#ifndef ONLINE_JUDGE
#ifdef LOCAL
	freopen("testdata.in", "r", stdin);
	freopen("testdata.out", "w", stdout);
#endif
#ifndef LOCAL
	freopen("StenierTree.in", "r", stdin);
	freopen("StenierTree.out", "w", stdout);
#endif
#endif

	scanf("%d%d%d", &n, &m, &k);
	int u, v, w;
	for (int i = 1; i <= m; ++i) {
		scanf("%d%d%d", &u, &v, &w);
		add(u, v, w);
		add(v, u, w);
	}
	memset(f, 0x3f, sizeof(f));
	for (int i = 0; i < k; ++i) {
		scanf("%d", &tar[i]);
		f[tar[i]][1 << i] = 0;
	}
	for (int i = 1; i < (1 << k); ++i) {
		for (int j = 1; j <= n; ++j) {
			for (int sta = i & (i - 1); sta; sta = i & (sta - 1)) {
				f[j][i] = min(f[j][i], f[j][sta] + f[j][i ^ sta]);
			}
			if (f[j][i] != 0x3f3f3f3f) pq.push({j, f[j][i]});
		}
		dij(i);
	}
	printf("%d", f[tar[0]][(1 << k) - 1]);
	return 0;
}